package multithread;

public class MyThread extends Thread{
    private String threadName;

    public MyThread(String str){
        threadName=str;
    }

    @Override
    public void run() {
        for (int i = 0; i < 5; i++) {
            try {
                sleep( (int)(Math.random()*1000) );
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println(threadName+"正在运行");


        }



    }
}
